package com.springboot.cloud.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.springboot.cloud.core.model.SystemUser;
import com.springboot.cloud.system.dao.SystemUserMapper;
import com.springboot.cloud.system.service.SystemUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Bertram
 * @since 2019-11-05
 */
@Service
public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemUser> implements SystemUserService {

    private SystemUserMapper systemUserMapper;

    public SystemUserServiceImpl(SystemUserMapper systemUserMapper) {
        this.systemUserMapper = systemUserMapper;
    }

    @Override
    public SystemUser getByUniqueId(String uniqueId) {
        LambdaQueryWrapper<SystemUser> userLambdaQueryWrapper = Wrappers.<SystemUser>lambdaQuery()
                .eq(SystemUser::getUserName, uniqueId);
        return systemUserMapper.selectOne(userLambdaQueryWrapper);
    }
}
